*{
    margin: 0;
    padding: 0;
}
/* 让容器的高度和宽度充满整给屏幕 */
html,body{
    width: 100%;
    height: 100%;
}
body{
    background-color: pink;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}
.heart{
    width: 200px;
    height: 200px;
    background-color: red;
    position: relative;
    /* 让爱心旋转45° */
    transform: rotate(45deg);
    animation: heartbit 1s alternate infinite;
}
.heart::before{
    content: "";
    width: 200px;
    height: 100px;
    background-color: red;
    /* 绝对定位 */
    position: absolute;
    left: 0;
    /* 不是-100是为了让半圆覆盖中间连接的线 */
    top: -99px;
    border-radius: 100px 100px 0 0;
}
.heart::after{
    content: "";
    width: 100px;
    height: 200px;
    background-color: red;
    position: absolute;
    /* 不是-100是为了让半圆覆盖中间连接的线 */
    left: -99px;
    top: 0;
    border-radius: 100px 0 0 100px ;
}
/* 实现动画，让心跳动起来 */   
@keyframes heartbit{
    0%{
        transform: rotate(45deg)  scale(0.6);
        box-shadow: 0 0 30px red ;                
    }
    /* 不用过度太多百分比，否则会不平滑 */
    100%{
        transform: rotate(45deg) scale(1.4);
        box-shadow: 0 0 30px red ;
    }
} 